Skip to main content

All Questions

0votes
1answer
2kviews

Sort on substring of line (not using a delimiter)

I need some help understanding how the sort command is working in the following examples: cat testfile The input data: thisfilehasduplicates thissnowhasfallen thisduckhasdied thishallwasfull ...
mjsqu's user avatar
1vote
2answers
357views

get count with grep

im working on sun10 Solaris os,i have a process that returns table as by using this command dmh -q 12 the below: *PROFILE PRIORITY COMM_TYPE QID # OF MSGS ATTRIBUTES/VALUES* 13 ...
mashro3ak's user avatar
-1votes
3answers
2kviews

Grouping data based on the second column

I have a file with the following lines: 1 a 2 a 3 a 1 b 2 b 1 c 2 c 3 c 4 c 1 d I want to get the result as: a 1 2 3 b 1 2 c 1 2 3 4 d 1
syed's user avatar
1vote
3answers
2kviews

How to switch first name with last name in this situation?

I'm given a file with many lines like so: Vinh Tranh:438-910-7449:8235 Maple Street, Wilmington, VM 29085:9/23/63:68900 I need to change the order from Firstname Lastname to Lastname, Firstname. I've ...
Ryan's user avatar
-1votes
1answer
46views

Separating single file into different files with respect to particular string

I have one file with following entries vdomain v2host v3server v1adapter vhost v2domain v1application I want to separate all these entries into 4 different files like file1 : should contain names ...
acroniks's user avatar
0votes
1answer
2kviews

Extracting specific data from SNMP

I've completed an SNMP poll to get different licenses from my routers. I've successfully polled the information; I now want to be able to present it. A snapshot of the output I have is: SNMPv2-SMI::...
Paul Davies's user avatar
0votes
3answers
2kviews

Combine lines whenever string matches in the file

I would like to combine two lines whenever the particular string is found in the file. Sample Input: { id: 23281598 total: { value: 3.0 } isThin: false raw: { ...
ayrton_senna's user avatar
1vote
1answer
63views

How to print selected number of lines in repeated fashion from a long file? [duplicate]

I want to be able print line 1,2,3,4,7 by skipping Lines 5,6,8,9 and repeat the pattern till the end of file. Sample INPUT: Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 ...
ayrton_senna's user avatar
2votes
3answers
1kviews

Find a particular pattern in a text file and exclude them from output?

I have a file that is around 25000 lines. Take a look at my sample input and required output INPUT: zone name tommy * pwwn xxxxxxxx pwwn xyzabcda * pwwn xcvuytnm zone name sammy * pwwn akslapsl * ...
ayrton_senna's user avatar
2votes
4answers
335views

How to merge 2 columns in a file alternatively?

How to merge 2 columns in a file alternatively? See below example. inputfile: sam jam tommy bond expected_output: sam jam tommy bond
ayrton_senna's user avatar
-2votes
2answers
92views

Search strings between two files

I have a two files, file1 and file2. In file1 contents are: ABC_DEC_EDC=ON WER_QSD_RCS=ON file2 contents are: TRD_OIY_REC=ON YUH_PON_UYT=ON WER_QSD_RCS=OFF I have to check line by line in file2. ...
suman's user avatar
4votes
4answers
889views

text processing rows to columns for a block

I have a file containing lists on Solaris: List A hi hello hw r u List B Hi Yes List C Hello I need to transpose the lists as shown below: List A List B List C hi Hi Hello ...
John's user avatar
1vote
3answers
1kviews

Why paste command doesn't work for Concatenating two files column wise when the characters are more than 511?

I am using a paste command to concatenate two .csv files column wise. These both files are huge file and when I run the paste command as below where comma(,) is the delimiter: paste -d',' file1.csv ...
tpsaitwal's user avatar
12votes
5answers
28kviews

Is there any alternative to the "sed -i" command in Solaris?

I have a requirement in my project to replace some existing text in a file like foo with some other text like fooofoo: abc.txt name foo foo1 So I tried: sed -i "s/foo/fooofoo/g" abc.txt However I ...
tpsaitwal's user avatar
1vote
1answer
48views

Problem with reading records from a file

I have the following problem: Script #!/usr/bin/ksh for unitcaseno in `cat /pims/nigel/UNLOAD-DB/xaa` do echo "String = $unitcaseno" unitno=`echo $unitcaseno | cut -d'|' -f1` ...
Nigel B's user avatar

153050per page
close